<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
@php
function cut_str($str,$len=16,$suffix="…"){
if(strlen($str) > $len){
if(function_exists('mb_substr')){
$str = mb_substr($str,0,$len,'utf-8').$suffix;
// $str = mb_substr($str,0,$len,'utf-8');
}else{
$str= substr($str,0,$len,'utf-8').$suffix;
// $str= substr($str,0,$len,'utf-8');
}
}
return $str;
}
function merge_str($str1,$str2,$suffix="——"){
$str = $str1;
if ($str2 != null) {
$str .= $suffix.$str2;
}
return $str;
}
@endphp